using System;
using System.Linq.Expressions;
using HslCommunication;

namespace HslCommunicationEx.HslNet
{
	public interface IBaseNetDeviceOpr
	{
		OperateResult ReadSingle<T>(Expression<Func<T, object>> exp, ushort len = 0);

		OperateResult ReadSingle<T>(string filedName, ushort len = 0);

		Tuple<T, OperateResult> ReadEntityMuti<T>(T dstT) where T : class, new();

		OperateResult WriteEntitySingle<T>(string filedName, dynamic value, ushort attempTimes = 0, ushort attempInterval = 30) where T : class, new();

		OperateResult WriteEntitySingle(Type entityType, string filedName, dynamic value, ushort attempTimes = 0, ushort attempInterval = 30);

		OperateResult WriteEntitySingle<T>(Expression<Func<T, object>> exp, dynamic value, ushort attempTimes = 0, ushort attempInterval = 30) where T : class, new();

		OperateResult WriteEntityMuti<T>(T entity, Expression<Func<T, object>> exp, ushort attempTimes = 0, ushort attempInterval = 30) where T : class, new();
	}
}
